home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
crypt
/
tarchiv
/
terase.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-01-27
|
2KB
|
72 lines
Program TErase;
Uses Dos,Crt,ASPI,Arc,Toolbox;
Const
Version = '1.0';
Var
LineStr : String[80];
TheTape : PASPITape;
Target : Byte;
Result : Integer;
DoIt : Boolean;
Ch : Char;
Procedure WaitForTape;
Var
A,B,C,D : Word;
CC : Word;
Begin
CC := 61;
Repeat
GetTime (A,B,C,D);
If CC<>C Then Begin
TheTape^.TestUnitReady;
CC := C;
End;
Until NOT TheTape^.Status.Error;
End;
Begin
LineStr[0]:=#80;
FillChar(LineStr[1],80,196);
Writeln (' TERSE ',Version,' - tape eraser and conditioner - A. Schiffler, U of S, 1994');
Write (LineStr);
If (ParamCount=1) Or (ParamCount=2) Then Begin
Val (ParamStr(1),Target,Result);
If Result=0 Then Begin
New (TheTape,Init(Target));
Writeln ('Waiting for tape to come online');
WaitForTape;
If Upper(ParamStr(2))='UNCOND' Then
DoIt := True
Else Begin
Writeln ('WARNING ! All information on tape will be deleted!');
Write ('Proceed with erase ? [y/n] ');
Ch := #0;
Repeat
IF Keypressed Then Ch := Readkey;
Until Ch<>#0;
Ch := UpCase(Ch);
DoIt := (Ch='Y');
Writeln;
End;
If DoIt Then Begin
Write ('Erasing tape (approx. 25 min/GByte) ...');
WaitForTape;
TheTape^.Erase;
WaitForTape;
TheTape^.Rewind;
WaitForTape;
End;
Dispose (TheTape,Done);
Exit;
End;
End;
Writeln ('Usage : terase <target number> [UNCOND]');
Writeln (' The keyword UNCOND is optional and will supress');
Writeln (' all saftey input from the user.');
End.